package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FlavorMapper {

    /**
     * 根据菜品删除对应的口味
     * @param
     */
    void getByDishId(List<Long> DishIds);


    /**
     * 根据id查询菜品
     * @param
     * @return
     */
    @Select("select id, dish_id, name, value from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByID(Long dishId);

    /**
     * 根据菜品id删除所有口味
     * @param id
     */
    @Delete("delete from dish_flavor where dish_id=#{id}")
    void delById(Long id);
}
